package com.open.capacity.forum.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.open.capacity.common.exception.service.ServiceException;
import com.open.capacity.forum.dao.ArticleTagsDao;
import com.open.capacity.forum.model.ArticleTags;
import com.open.capacity.forum.service.ArticleTagsSerivce;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class ArticleTagsServiceImpl extends ServiceImpl<ArticleTagsDao, ArticleTags> implements ArticleTagsSerivce {
    @Override
    public List<ArticleTags> findByUserId(Long userId) {
        try {
            return lambdaQuery().eq(ArticleTags::getUserid, userId).list();
        } catch (Exception e) {
            log.warn(e.getMessage());
            throw new ServiceException(e);
        }
    }
}
